﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SHDM.Cache
{
    public class Cacher
    {
        static ICacheManager _Instance = null;
        public static ICacheManager Instance
        {
            get
            {
                if (_Instance == null)
                {
                    if (Conf.CacheType == "Redis" && !string.IsNullOrEmpty(Conf.RedisConnectString))
                    {
                        _Instance = new RedisCacheManager(Conf.RedisConnectString);
                    }
                    else
                    {
                        _Instance = new MemoryCacheManager();
                    }
                }
                return _Instance;
            }
        }

        public struct KeySpace
        {
            public const string UserToken = "UserToken";
        }
    }
}
